package com.bigshen.demo.annotation.configurecomponents.a0Configuration;

import com.bigshen.demo.project.entity.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyConfig {

    /**
     * 1. 默认类名首字母小写
     * 2. 其次就是取方法名
     * 3. 最后优先取Bean的value
     * @return
     */
    @Bean(value = "myPerson")
    public Person getPerson() {
        System.out.println("create person by myself");
        return new Person("shen", "18");
    }

}
